package com.example.springboot.controller;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.servlet.ServletRequest;
import javax.servlet.http.HttpServletRequest;
/**
 * @Author:
 * @Version: v1.0
 */
@RestController
@CrossOrigin
public class KaptchaController {
    @GetMapping("/hello")
    public String hello(ServletRequest request, String yanzheng) {

        HttpServletRequest req = (HttpServletRequest)request;
        String yan2 = (String) req.getSession().getAttribute("verifyCode");
        System.out.println(yan2);
        if(yanzheng.equals(yan2)){
            return "page";
        }
            return "nopage";

//        if (!CodeUtil.checkVerifyCode(request)) {
//            return "cuowu";
//        } else {
//            return "hello,world";
//        }
    }
}
